//
//  HACChartViewBase.h
//  Pods
//
//  Created by Hotacool on 2017/8/30.
//
//

#import <UIKit/UIKit.h>
#import "HACAxisProvider.h"
#import "HACAxisRenderer.h"
#import "HACBasicInfoEntry.h"
#import "HACAnimator.h"
#import "HACBasicComponents.h"

@interface HACChartView : UIView <HACAxisProvider, HACAnimatorDelegate>
/** x轴分割线数 */
@property (nonatomic) NSInteger xAxisCount;
/** y轴分割线数 */
@property (nonatomic) NSInteger yAxisCount;
/** 数据点显示rect */
@property (nonatomic, assign) CGRect pointRect;
/** 起始index，按照0方式计数 */
@property (nonatomic) NSInteger startIndex;
/** 实际结束的index */
@property (nonatomic) NSInteger endIndex;
/** 当前实际数据（数组的count） */
@property (nonatomic, readonly) NSInteger actualCount;
/** 当前绘图区域需要显示的数目，分时的值是固定，k线的值会跟随放大，缩小手势变化,用于计算x坐标*/
@property (nonatomic) NSInteger visualCount;
/** 单个宽度,由visualCount和frame决定 */
@property (nonatomic) CGFloat singleWidth;
/** 间隙,默认1，可以间接控制rect宽度singleWidth - itemsSpace， */
@property (nonatomic) CGFloat itemsSpace;
@property (nonatomic) CGFloat maxValue;/** 所有数据中最大值，包括指标(用于确定绘图上下边界) */
@property (nonatomic) CGFloat minValue;/** 所有数据中最小值，包括指标(用于确定绘图上下边界) */
@property (nonatomic, strong) HACChartData *data;

/** 基本数据 */
@property (nonatomic, strong) HACBasicInfoEntry *basicInfoData;
/// the object representing the left y-axis
@property (nonatomic, strong) HACAxisComponents *leftAxis;
/// the object representing the right y-axis
@property (nonatomic, strong) HACAxisComponents *rightAxis;
// renderer
@property (nonatomic, strong, readonly) HACAxisRenderer *axisXRenderer;
@property (nonatomic, strong, readonly) HACAxisRenderer *axisYRenderer;
// animator
@property (nonatomic, strong) HACAnimator *animator;

- (void)setUp ;

- (void)refreshUI;

- (void)clean;

- (void)updateFrame ;

- (NSUInteger)indexAtChartForCoordinate:(CGPoint)point ;

- (CGPoint)pointAtChartForIndex:(NSUInteger)index ;

- (HACChartDataEntry*)dataAtChartForCoordinate:(CGPoint)point ;

- (HACChartDataEntry*)dataAtChartForIndex:(NSUInteger)index ;
@end
